package com.sanyang.pda.adapter;

import android.widget.CheckBox;
import android.widget.CompoundButton;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sanyang.pda.bean.UnderDetectionBean;
import com.wangshen.base.ui.mvp.base.adapter.BaseAdapter;
import com.wangshen.projectbase.R;

import java.util.List;

public class UnderDetectionAdapter extends BaseAdapter<UnderDetectionBean> {
    public UnderDetectionAdapter(int layoutResId, @Nullable List<UnderDetectionBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, UnderDetectionBean item) {
        super.convert(helper, item);
        helper.setText(R.id.tv_samplingNo,item.getSamplingNo());
        helper.setText(R.id.tv_articleName,item.getArticleName());
        helper.setText(R.id.tv_spec,item.getSpec());
        helper.setText(R.id.tv_entryNo,item.getEntryNo());
        helper.setText(R.id.tv_fromPallet,item.getFromPallet()+"");
        helper.setText(R.id.tv_samplingNum,item.getSamplingNum()+"");
        helper.setText(R.id.tv_samplingType,item.getSamplingType()+"");
        //helper.setText(R.id.tv_samplingNo,item.getSamplingNo());
       /* CheckBox checkBox=helper.getView(R.id.cb_select);
        checkBox.setChecked(item.isSelect());
        checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                item.setSelect(isChecked);
            }
        });*/
    }
}
